package com.cyw.search.entity.user;

import cn.easyes.annotation.IndexField;
import cn.easyes.annotation.IndexId;
import cn.easyes.annotation.IndexName;
import cn.easyes.common.enums.FieldType;
import cn.easyes.common.enums.IdType;
import com.cyw.common.core.domain.entity.SysUser;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.HashSet;
import java.util.Set;

/**
 * @Author: Chenyw
 * @Date: 2022/11/04/13:56
 */
@Data
@ApiModel("用户")
@IndexName(value = "user_document",shardsNum = 3,replicasNum = 2)
public class EsUser {

    @ApiModelProperty("用户id")
    @IndexId(type = IdType.CUSTOMIZE)
    private Long userId;

    @ApiModelProperty("经纬度")
    @IndexField(fieldType = FieldType.GEO_POINT)
    private String location;

    @ApiModelProperty("位置描述")
    @IndexField(fieldType = FieldType.KEYWORD)
    private String address;

    @ApiModelProperty("创建时间")
    @IndexField(fieldType = FieldType.DATE, dateFormat = "yyyy-MM-dd HH:mm:ss||yyyy-MM-dd||epoch_millis")
    private String createTime;

    @ApiModelProperty("修改时间")
    @IndexField(fieldType = FieldType.DATE, dateFormat = "yyyy-MM-dd HH:mm:ss||yyyy-MM-dd||epoch_millis")
    private String updateTime;

    @ApiModelProperty("用户详情")
    @IndexField(fieldType = FieldType.OBJECT)
    private SysUser sysUser;

    @ApiModelProperty("用户得分")
    @IndexField(fieldType = FieldType.KEYWORD)
    private String score;

    @ApiModelProperty("关注我的列表")
    @IndexField(fieldType = FieldType.KEYWORD)
    private Set<Long> loveMeSet = new HashSet<>();

    @ApiModelProperty("我关注的列表")
    @IndexField(fieldType = FieldType.KEYWORD)
    private Set<Long> iLoveSet = new HashSet<>();
}
